package a.e.b.c;

import a.c.bb;
import a.c.d;
import a.c.e;
import a.e.b.i;

import java.util.*;

class k
{
  private c_ a = new c_();
  private c_ b;
  private n c;
  private j d;
  static Class e;
  static Class f;
  static Class g;
  static Class h;
  
  public k(Map paramMap)
  {
    Iterator localIterator1 = i.a().iterator();
    break label74;
    label34:
    if (localIterator1.hasNext()) {}
    label74:
    while (bool2)
    {
      i locali = (i)localIterator1.next();
      Collection localCollection = (Collection)paramMap.get(locali);
      Iterator localIterator2 = localCollection.iterator();
      if (!localIterator2.hasNext()) {
        break label34;
      }
      s locals = (s)localIterator2.next();
      this.a.a(locali, new b_(locals, null));
      if ((bool2) || ((!bool2) && (bool1)) || ((!bool2) && (bool1))) {
        return;
      }
      if (!bool1) {
        break;
      }
    }
    this.b = a(this.a);
  }
  
  private c_ a(c_ paramc_)
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    c_ localc_ = new c_();
    Collection localCollection1 = paramc_.a(i.b);
    Iterator localIterator1 = i.a().iterator();
    do
    {
      i locali;
      Iterator localIterator2;
      while (!localIterator2.hasNext())
      {
        if (!localIterator1.hasNext()) {
          break;
        }
        locali = (i)localIterator1.next();
        Collection localCollection2 = paramc_.a(locali);
        ArrayList localArrayList = new ArrayList(localCollection2);
        if (!bool2)
        {
          if (locali != i.b) {
            localArrayList.addAll(localCollection1);
          }
          a.i.l.a(localArrayList, new Comparator()
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              k.b_ localb_1 = (k.b_)paramAnonymousObject1;
              k.b_ localb_2 = (k.b_)paramAnonymousObject2;
              return localb_1.a().a().compareTo(localb_2.a().a());
            }
          });
        }
        localIterator2 = localArrayList.iterator();
      }
      b_ localb_ = (b_)localIterator2.next();
      if (!bool2)
      {
        if ((bool2) || (bool1)) {
          break label178;
        }
        localc_.a(locali, localb_);
      }
    } while ((!bool2) && ((!bool1) && (!bool1)));
    label178:
    return localc_;
  }
  
  void a(o paramo)
    throws a
  {
    boolean bool = a.b;
    if (!bool) {}
    n localn = (n)paramo.a(e == null ? (k.e = a("a.e.b.c.n")) : e);
    if (!bool) {
      if (localn != null)
      {
        this.c = localn;
        if (!bool) {
          if (!a.a) {
            break label122;
          }
        }
      }
      else
      {
        this.c = new m();
      }
    }
    Object localObject = new l(paramo);
    if (!bool) {}
    ((l)localObject).a(e == null ? (k.e = a("a.e.b.c.n")) : e, this.c);
    paramo = (o)localObject;
    label122:
    if (!bool) {}
    localObject = (j)paramo.a(f == null ? (k.f = a("a.e.b.c.j")) : f);
    if (!bool) {}
    this.d = (localObject == null ? new j() : (j)localObject);
    b(paramo);
  }
  
  private void b(o paramo)
    throws a
  {
    cb localcb = paramo.d();
    localcb.c();
    this.d.a(new fb(this, paramo, null));
    c(paramo);
    this.d.b(new fb(this, paramo, null));
    localcb.a();
  }
  
  private void c(o paramo)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    String str1 = (String)paramo.a("GraphMLRootPrefix");
    if (!bool2)
    {
      if (str1 != null) {
        paramo.d().a(str1, "graphml", "http://graphml.graphdrawing.org/xmlns");
      }
    }
    else
    {
      if (bool2) {
        break label91;
      }
      if (!bool1) {
        break label74;
      }
    }
    paramo.d().a("graphml", "http://graphml.graphdrawing.org/xmlns");
    label74:
    this.d.k(new fb(this, paramo, null));
    label91:
    String str2 = (String)paramo.a("HeaderComment");
    if (!bool2)
    {
      if (str2 != null)
      {
        if (bool2) {
          break label143;
        }
        if (str2.length() > 0) {
          paramo.d().a(str2);
        }
      }
      e(paramo);
    }
    label143:
    int i = 0;
    Collection localCollection = this.b.a(i.g);
    Object localObject = localCollection.iterator();
    do
    {
      if (!((Iterator)localObject).hasNext()) {
        break;
      }
      b_ localb_ = (b_)((Iterator)localObject).next();
      if (bool1) {
        break label289;
      }
      if (i == 0)
      {
        if (bool2) {
          continue;
        }
        if (localb_.a().a().compareTo(ab.c) > 0)
        {
          l locall = new l(paramo, paramo.e());
          locall.a("y.io.graphml.output.SerializationProperties.CURRENT_KEY_SCOPE", i.e);
          a(locall, locall.e());
          i = 1;
        }
      }
      a(paramo, localb_.b(), localb_.a());
    } while (!bool1);
    if (!bool2)
    {
      if (i == 0)
      {
        label289:
        localObject = new l(paramo, paramo.e());
        a((o)localObject, ((o)localObject).e());
      }
      this.d.l(new fb(this, paramo, null));
      paramo.d().b();
    }
  }
  
  private void e(o paramo)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    int i = 0;
    HashSet localHashSet = new HashSet();
    Iterator localIterator1 = i.a().iterator();
    label68:
    label235:
    do
    {
      break label68;
      i locali;
      b_ localb_;
      String str;
      do
      {
        Iterator localIterator2;
        do
        {
          if (!localIterator1.hasNext()) {
            break;
          }
          locali = (i)localIterator1.next();
          localIterator2 = this.a.a(locali).iterator();
        } while (!localIterator2.hasNext());
        localb_ = (b_)localIterator2.next();
        str = "d" + i;
        if (bool2) {
          break;
        }
      } while (bool1);
      Iterator localIterator3 = localb_.a().b().iterator();
      while (localIterator3.hasNext())
      {
        q localq = (q)localIterator3.next();
        if (((bool2) || ((localq.b() == null) || ((bool2) || (localq.b().equals("http://graphml.graphdrawing.org/xmlns"))))) && ("id".equals(localq.a())))
        {
          str = localq.c();
          if (bool2) {
            break label235;
          }
          if (bool2) {
            break label315;
          }
          if (bool1) {
            break label313;
          }
        }
      }
      if (localHashSet.contains(str))
      {
        i++;
        str = "d" + i;
      }
      for (;;)
      {
        if (!bool2) {
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            localHashSet.add(str);
            localb_.a(str);
            a(paramo, localb_.a(), str, locali);
            if (bool2) {
              continue;
            }
            i++;
          }
        }
      }
    } while (!bool1);
    label313:
    label315:
    return;
  }
  
  private void a(o paramo, s params, String paramString, i parami)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    paramo.d().a("key", "http://graphml.graphdrawing.org/xmlns");
    int i = 0;
    Iterator localIterator = params.b().iterator();
    if (localIterator.hasNext()) {}
    label147:
    label163:
    while (bool2)
    {
      q localq = (q)localIterator.next();
      if (bool2) {
        break label188;
      }
      if (bool1) {
        break label186;
      }
      if (!bool2) {
        if (localq.b() != null)
        {
          if (bool2) {
            break label163;
          }
          if (!localq.b().equals("http://graphml.graphdrawing.org/xmlns")) {
            break label147;
          }
        }
      }
      if ((!bool2) && ("id".equals(localq.a()))) {
        break;
      }
      if (!bool2)
      {
        if ("for".equals(localq.a())) {
          i = 1;
        }
        paramo.d().a(localq);
      }
      if (!bool1) {
        break;
      }
    }
    paramo.d().c("id", paramString);
    label186:
    if (i == 0) {
      label188:
      if (parami != i.g) {
        paramo.d().c("for", parami.toString().toLowerCase(Locale.US));
      }
    }
    this.d.o(new fb(this, paramo, params));
    params.c(paramo);
    this.d.p(new fb(this, paramo, params));
    paramo.d().b();
  }
  
  private void a(o paramo, String paramString, s params)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    if (!bool2)
    {
      if (!params.a(paramo))
      {
        paramo.d().a("data", "http://graphml.graphdrawing.org/xmlns");
        paramo.d().c("key", paramString);
      }
    }
    else
    {
      Iterator localIterator = params.c().iterator();
      label177:
      do
      {
        q localq;
        do
        {
          do
          {
            if (!localIterator.hasNext()) {
              break label180;
            }
            localq = (q)localIterator.next();
            if (!bool2) {
              if (localq.b() != null)
              {
                if (bool2) {
                  break label177;
                }
                if (!localq.b().equals("http://graphml.graphdrawing.org/xmlns")) {
                  break;
                }
              }
            }
          } while ("id".equals(localq.a()));
          if (bool2) {
            break label177;
          }
        } while ("for".equals(localq.a()));
        paramo.d().a(localq);
        if (bool2) {
          break label221;
        }
      } while (!bool1);
      label180:
      this.d.m(new fb(this, paramo, params));
      params.b(paramo);
      this.d.n(new fb(this, paramo, params));
      label221:
      paramo.d().b();
    }
  }
  
  private void a(o paramo, a.c.q paramq)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    paramo.d().a("graph", "http://graphml.graphdrawing.org/xmlns");
    n localn = a();
    String str = localn.a(paramq, paramo);
    if (!bool2)
    {
      if (str != null) {
        paramo.d().c("id", str);
      }
      paramo.d().c("edgedefault", "directed");
      this.d.i(new fb(this, paramo, paramq));
    }
    int i = 0;
    Collection localCollection = this.b.a(i.e);
    Iterator localIterator = localCollection.iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      b_ localb_ = (b_)localIterator.next();
      if (bool1) {
        break label215;
      }
      if (i == 0)
      {
        if (bool2) {
          continue;
        }
        if (localb_.a().a().compareTo(ab.c) > 0)
        {
          f(paramo);
          i = 1;
        }
      }
      a(paramo, localb_.b(), localb_.a());
    } while (!bool1);
    if (!bool2)
    {
      if (i == 0) {
        label215:
        f(paramo);
      }
      this.d.j(new fb(this, paramo, paramq));
      paramo.d().b();
    }
  }
  
  private void f(o paramo)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    if (!bool2) {}
    r localr = (r)paramo.a(g == null ? (k.g = a("a.e.b.c.r")) : g);
    e locale = null;
    bb localbb;
    a.c.ab localab;
    if (localr != null)
    {
      if ((bool2) || (paramo.a().size() > 2))
      {
        localObject1 = paramo.a().iterator();
        ((Iterator)localObject1).next();
        locale = (e)((Iterator)localObject1).next();
      }
      else
      {
        locale = localr.a(paramo);
      }
      localbb = localr.b(paramo, locale);
      localab = localr.a(paramo, paramo.e());
    }
    else
    {
      localbb = new bb(paramo.e().v());
      localab = new a.c.ab(paramo.e().w());
    }
    Object localObject1 = localbb.iterator();
    if (((Iterator)localObject1).hasNext()) {}
    Object localObject2;
    l locall;
    while (bool2)
    {
      localObject2 = (e)((Iterator)localObject1).next();
      locall = new l(paramo, localObject2);
      locall.a("y.io.graphml.output.SerializationProperties.CURRENT_KEY_SCOPE", i.c);
      a(locall, (e)localObject2);
      if (!bool1) {
        break;
      }
    }
    localObject1 = localab.l();
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      locall = new l(paramo, localObject2);
      locall.a("y.io.graphml.output.SerializationProperties.CURRENT_KEY_SCOPE", i.d);
      a(locall, (d)localObject2);
      ((a.c.m)localObject1).f();
    } while (!bool1);
  }
  
  private void a(o paramo, d paramd)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    if (!bool2) {}
    r localr = (r)paramo.a(g == null ? (k.g = a("a.e.b.c.r")) : g);
    e locale1;
    if ((bool2) || (localr != null))
    {
      locale1 = localr.a(paramo, paramd);
      locale2 = localr.b(paramo, paramd);
      if (!bool2) {
        if (!bool1) {
          break label99;
        }
      }
    }
    else
    {
      locale1 = paramd.e();
    }
    e locale2 = paramd.f();
    label99:
    if ((bool2) || ((locale1 == null) || (locale2 == null))) {
      return;
    }
    String str1 = a().a(locale1, paramo);
    String str2 = a().a(locale2, paramo);
    paramo.d().a("edge", "http://graphml.graphdrawing.org/xmlns");
    String str3 = a().a(paramd, paramo);
    if (!bool2)
    {
      if (str3 != null) {
        paramo.d().c("id", str3);
      }
      paramo.d().c("source", str1);
      paramo.d().c("target", str2);
    }
    if (!bool2) {}
    u localu = (u)paramo.a(h == null ? (k.h = a("a.e.b.c.u")) : h);
    Object localObject3;
    if (!bool2)
    {
      if (localu != null)
      {
        localObject1 = localu.a(paramd, paramo);
        localObject2 = localu.b(paramd, paramo);
        if (!bool2) {
          if (localObject1 != null)
          {
            localObject3 = a().a((a.e.b.n)localObject1, paramd.e(), paramo);
            paramo.d().c("sourceport", (String)localObject3);
          }
        }
        if (localObject2 != null)
        {
          localObject3 = a().a((a.e.b.n)localObject2, paramd.f(), paramo);
          paramo.d().c("targetport", (String)localObject3);
        }
      }
      this.d.e(new fb(this, paramo, paramd));
    }
    Object localObject1 = this.b.a(i.d);
    Object localObject2 = ((Collection)localObject1).iterator();
    if (((Iterator)localObject2).hasNext()) {}
    do
    {
      localObject3 = (b_)((Iterator)localObject2).next();
      a(paramo, ((b_)localObject3).b(), ((b_)localObject3).a());
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
      this.d.f(new fb(this, paramo, paramd));
    } while (bool2);
    paramo.d().b();
  }
  
  private void a(o paramo, e parame)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    String str = a().a(parame, paramo);
    paramo.d().a("node", "http://graphml.graphdrawing.org/xmlns");
    paramo.d().c("id", str);
    this.d.c(new fb(this, paramo, parame));
    int i = 0;
    Collection localCollection = this.b.a(i.c);
    Iterator localIterator = localCollection.iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      b_ localb_ = (b_)localIterator.next();
      if (bool1) {
        break label186;
      }
      if (i == 0)
      {
        if (bool2) {
          continue;
        }
        if (localb_.a().a().compareTo(ab.c) > 0)
        {
          b(paramo, parame);
          i = 1;
        }
      }
      a(paramo, localb_.b(), localb_.a());
    } while (!bool1);
    if (!bool2)
    {
      if (i == 0) {
        label186:
        b(paramo, parame);
      }
      this.d.d(new fb(this, paramo, parame));
      paramo.d().b();
    }
  }
  
  private void b(o paramo, e parame)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    if (!bool2) {}
    r localr = (r)paramo.a(g == null ? (k.g = a("a.e.b.c.r")) : g);
    if (((bool2) || (localr != null)) && (!localr.a(paramo, parame)))
    {
      localObject = new l(paramo, localr.d(paramo, parame));
      ((l)localObject).a("y.io.graphml.output.SerializationProperties.CURRENT_KEY_SCOPE", i.e);
      a((o)localObject, ((l)localObject).e());
    }
    if (!bool2) {}
    Object localObject = (u)paramo.a(h == null ? (k.h = a("a.e.b.c.u")) : h);
    if ((bool2) || (localObject != null))
    {
      Collection localCollection = ((u)localObject).a(parame, paramo);
      if ((bool2) || (localCollection != null))
      {
        Iterator localIterator = localCollection.iterator();
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          a.e.b.n localn = (a.e.b.n)localIterator.next();
          l locall = new l(paramo, localn);
          locall.a("y.io.graphml.output.SerializationProperties.CURRENT_KEY_SCOPE", i.f);
          a(locall, parame, localn);
        } while (!bool1);
      }
    }
  }
  
  private void a(o paramo, e parame, a.e.b.n paramn)
    throws a
  {
    boolean bool2 = a.b;
    boolean bool1 = a.a;
    String str = a().a(paramn, parame, paramo);
    paramo.d().a("port", "http://graphml.graphdrawing.org/xmlns");
    paramo.d().c("name", str);
    this.d.g(new fb(this, paramo, paramn));
    Collection localCollection = this.b.a(i.f);
    Iterator localIterator = localCollection.iterator();
    if (localIterator.hasNext()) {}
    do
    {
      b_ localb_ = (b_)localIterator.next();
      a(paramo, localb_.b(), localb_.a());
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
      this.d.h(new fb(this, paramo, paramn));
    } while (bool2);
    paramo.d().b();
  }
  
  private n a()
  {
    return this.c;
  }
  
  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  static class c_
  {
    private HashMap a = new HashMap();
    
    public c_()
    {
      Iterator localIterator = i.a().iterator();
      do
      {
        if (!localIterator.hasNext()) {
          break;
        }
        i locali = (i)localIterator.next();
        this.a.put(locali, new LinkedList());
      } while (!bool);
    }
    
    public Collection a(i parami)
    {
      return (Collection)this.a.get(parami);
    }
    
    public void a(i parami, k.b_ paramb_)
    {
      a(parami).add(paramb_);
    }
    
    public Map a()
    {
      return this.a;
    }
  }
  
  private static class b_
  {
    private s a;
    private String b;
    
    public b_(s params, String paramString)
    {
      this.a = params;
      this.b = paramString;
    }
    
    public s a()
    {
      return this.a;
    }
    
    public String b()
    {
      return this.b;
    }
    
    public void a(String paramString)
    {
      this.b = paramString;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.c.k

 * JD-Core Version:    0.7.0.1

 */